{% extends 'base.html' %}

{% block title %}用户中心 {% endblock %}

{% block main_con %}
    <div class="main_con clearfix">
        <div class="left_menu_con clearfix">
            <h3>用户中心</h3>
            <ul>
                <li><a href="/usercenter" class="active">· 个人信息</a></li>
                <li><a href="{{ url("user:user_order", args=(1,))}}">· 全部订单</a></li>
                <li><a href="/address">· 收货地址</a></li>
                <li><a href="/password">· 修改密码</a></li>
            </ul>
        </div>
        <div class="right_content clearfix">
            <div class="info_con clearfix" v-cloak>
                <h3 class="common_title2">基本信息</h3>
                <ul class="user_info_list">
                    <li><span>用户名：</span>[[ username ]]</li>
                    <li><span>联系方式：</span>[[ mobile ]]</li>
                    <li>
                        <span>Email：</span>
                        <div v-if="set_email">
                            <input v-model="email" @blur="check_email" type="email" name="email" class="email">
                            <input @click="save_email" type="button" name="" value="保 存">
                            <input @click="cancel_email" type="reset" name="" value="取 消">
                            <div v-show="error_email" class="error_email_tip">邮箱格式错误</div>
                        </div>
                        <div v-else>
                            <input v-model="email" type="email" name="email" class="email" readonly>
                            <div v-if="email_active">
                                已验证
                            </div>
                            <div v-else>
                                待验证<input @click="save_email" :disabled="send_email_btn_disabled" type="button"
                                          :value="send_email_tip">
                            </div>
                        </div>
                    </li>
                </ul>
            </div>

            <h3 class="common_title2">最近浏览</h3>
            <div class="has_view_list" v-cloak>
            <ul class="goods_type_list clearfix">
            <li v-for="sku in histories">
            <a :href="sku.url"><img :src="sku.default_image_url"></a>
            <h4><a :href="sku.url">[[ sku.name ]]</a></h4>
            <div class="operate">
                <span class="price">￥[[ sku.price ]]</span>
                <span class="unit">台</span>
                <a href="javascript:;" class="add_goods" title="加入购物车"></a>
            </div>
        </li>
        </ul>
    </div>
</div>
    </div>
{% endblock %}

{% block bootm_script %}
    <script type="text/javascript">
    let username = "{{ username }}";
    let mobile = "{{ mobile }}";
    let email = "{{ email }}";
    let email_active = "{{ email_active }}";
</script>
{% endblock %}

{% block bootom_link_js %}
    <script type="text/javascript" src="{{ static('js/base.js') }}"></script>
    <script type="text/javascript" src="{{ static('js/user_center_info.js') }}"></script>

{% endblock %}


